<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import = "java.util.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<h1>Publications</h1>
<a href="<%= request.getContextPath() %>/publication?elib_action=CREATE">Add Publication</a>

<div>
 <table>
     <tr>
         <th>ID</th>
         <th>Titel</th>
         <th>Untertitel</th>
         <th>Autoren</th>
         <th>Autoren (katalog.)</th>
         <th>Library</th>
         <th></th>
     </tr>
     <c:forEach items="${publications}" var="publication">
         <tr>
             <td><c:out value="${publication.id}" /></td>
             <td><c:out value="${publication.title}" /></td>
             <td><c:out value="${publication.subtitle}" /></td>
             <td><c:out value="${publication.author}" /></td>
             <td><c:forEach items="${publication.authors}" var="a">${a.name}<br /></c:forEach></td>
             <td><c:out value="${publication.library.name}" /></td>
             <td>
             	<a href="publication?elib_action=READ&id=<c:out value="${publication.id}" />">edit</a>
             	<a href="publication?elib_action=DELETE&id=<c:out value="${publication.id}" />">delete</a>
             </td>
         </tr>
     </c:forEach>
 </table>
</div>